package com.jdd.common.client.vo;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @version 1.0
 * @author： jdd尚岳
 * @date： 2021-01-15 09:41
 */
@ToString
public class SynObjectVO <T>{

    @Setter(value = AccessLevel.PRIVATE)
    @Getter(value = AccessLevel.PUBLIC)
    private T object;
    @Setter(value = AccessLevel.PRIVATE)
    @Getter(value = AccessLevel.PUBLIC)
    private String options;
    @Setter(value = AccessLevel.PRIVATE)
    @Getter(value = AccessLevel.PUBLIC)
    private String className;

    private SynObjectVO(){

    }

    public  static <T>  SynObjectVO getAddObject(T object){
        SynObjectVO synObject = new SynObjectVO();
        synObject.object = object;
        synObject.className = object.getClass().getSimpleName();
        synObject.options = "add";
        return synObject;
    }
    public static  <T>  SynObjectVO getUpdateObject(T object){
        SynObjectVO synObject = new SynObjectVO();
        synObject.object = object;
        synObject.className = object.getClass().getSimpleName();
        synObject.options = "update";
        return synObject;
    }
    public static  <T>  SynObjectVO getDeleteObject(T object){
        SynObjectVO synObject = new SynObjectVO();
        synObject.object = object;
        synObject.className = object.getClass().getSimpleName();
        synObject.options = "delete";
        return synObject;
    }



}
